package com.ruoyi.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 库存对象 inventory
 *
 * @author ruoyi
 * @date 2025-10-10
 */
public class Inventory extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键（自增） */
    private Long id;

    /** 关联商品表id（外键，商品删除时同步删库存） */
    @Excel(name = "关联商品表id", readConverterExp = "外=键，商品删除时同步删库存")
    private Long productId;

    /** 仓库名称（如“总仓”） */
    @Excel(name = "仓库名称", readConverterExp = "如=“总仓”")
    private String warehouse;

    /** 货位（如“A区货架”） */
    @Excel(name = "货位", readConverterExp = "如=“A区货架”")
    private String location;

    /** 库存数量（必填） */
    @Excel(name = "库存数量", readConverterExp = "必=填")
    private Long quantity;

    /** 低库存预警阈值（默认10） */
    @Excel(name = "低库存预警阈值", readConverterExp = "默=认10")
    private Long lowStockThreshold;

    /** 最后操作人 */
    @Excel(name = "最后操作人")
    private String lastOperator;

    /** 最后操作时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date lastOperateTime;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setProductId(Long productId)
    {
        this.productId = productId;
    }

    public Long getProductId()
    {
        return productId;
    }

    public void setWarehouse(String warehouse)
    {
        this.warehouse = warehouse;
    }

    public String getWarehouse()
    {
        return warehouse;
    }

    public void setLocation(String location)
    {
        this.location = location;
    }

    public String getLocation()
    {
        return location;
    }

    public void setQuantity(Long quantity)
    {
        this.quantity = quantity;
    }

    public Long getQuantity()
    {
        return quantity;
    }

    public void setLowStockThreshold(Long lowStockThreshold)
    {
        this.lowStockThreshold = lowStockThreshold;
    }

    public Long getLowStockThreshold()
    {
        return lowStockThreshold;
    }

    public void setLastOperator(String lastOperator)
    {
        this.lastOperator = lastOperator;
    }

    public String getLastOperator()
    {
        return lastOperator;
    }

    public void setLastOperateTime(Date lastOperateTime)
    {
        this.lastOperateTime = lastOperateTime;
    }

    public Date getLastOperateTime()
    {
        return lastOperateTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("productId", getProductId())
            .append("warehouse", getWarehouse())
            .append("location", getLocation())
            .append("quantity", getQuantity())
            .append("lowStockThreshold", getLowStockThreshold())
            .append("lastOperator", getLastOperator())
            .append("lastOperateTime", getLastOperateTime())
            .toString();
    }
}
